Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
@types/jest
Advanced tools
The @types/jest package provides TypeScript type definitions for Jest, a popular JavaScript testing framework. This allows developers to use Jest in TypeScript projects with type checking and IntelliSense support for Jest's API.
Type Definitions for Jest Functions
Provides type definitions for Jest's global functions like 'test' and 'expect', enabling type checking and autocompletion in TypeScript.
test('adds 1 + 2 to equal 3', () => {
expect(1 + 2).toBe(3);
});
Type Definitions for Matchers
Includes type definitions for Jest's matchers, such as 'toMatch', 'toBe', and 'toHaveProperty', ensuring correct usage with TypeScript.
expect('hello').toMatch(/hello/);
Type Definitions for Mock Functions
Provides type definitions for Jest's mock functions and their methods like 'mockReturnValue' and 'mockImplementation'.
const mockFunction = jest.fn();
mockFunction.mockReturnValue('default value');
Type Definitions for Jest Configuration
Offers type definitions for Jest configuration options, which can be used when setting up Jest in a TypeScript project.
const jestConfig = {
verbose: true,
collectCoverage: true
};
Provides TypeScript type definitions for Mocha, another testing framework. Similar to @types/jest, it allows developers to use Mocha with TypeScript's type checking.
Offers type definitions for Chai, an assertion library that can be used with testing frameworks like Mocha. It serves a similar purpose to @types/jest but for Chai's API.
Contains TypeScript type definitions for Sinon, a library for spies, stubs, and mocks in JavaScript tests. It is similar to the mock functionality provided by Jest and its type definitions in @types/jest.
npm install --save @types/jest
This package contains type definitions for Jest (https://jestjs.io/).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jest.
afterAll
, afterEach
, beforeAll
, beforeEach
, describe
, expect
, fail
, fdescribe
, fit
, it
, jasmine
, jest
, pending
, spyOn
, test
, xdescribe
, xit
, xtest
These definitions were written by Asana (https://asana.com) // Ivo Stratev (https://github.com/NoHomey), jwbay (https://github.com/jwbay), Alexey Svetliakov (https://github.com/asvetliakov), Alex Jover Morales (https://github.com/alexjoverm), Allan Lukwago (https://github.com/epicallan), Ika (https://github.com/ikatyang), Waseem Dahman (https://github.com/wsmd), Jamie Mason (https://github.com/JamieMason), Douglas Duteil (https://github.com/douglasduteil), Ahn (https://github.com/ahnpnl), Josh Goldberg (https://github.com/joshuakgoldberg), Jeff Lau (https://github.com/UselessPickles), Andrew Makarov (https://github.com/r3nya), Martin Hochel (https://github.com/hotell), Sebastian Sebald (https://github.com/sebald), Andy (https://github.com/andys8), Antoine Brault (https://github.com/antoinebrault), Jeroen Claassens (https://github.com/favna), Gregor Stamać (https://github.com/gstamac), ExE Boss (https://github.com/ExE-Boss), Alex Bolenok (https://github.com/quassnoi), Mario Beltrán Alarcón (https://github.com/Belco90), Tony Hallett (https://github.com/tonyhallett), Jason Yu (https://github.com/ycmjason), and Devansh Jethmalani (https://github.com/devanshj).
FAQs
TypeScript definitions for jest
The npm package @types/jest receives a total of 22,719,819 weekly downloads. As such, @types/jest popularity was classified as popular.
We found that @types/jest demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.